#include <iostream>
#include <vector>
#include <string>
using namespace std;

/*
Templatize the Int class in TPStash2Test.cpp 
so that it holds any type of object (feel free to change the name of the class to something more appropriate).
*/
template<class type>
class T {
	type i;
public:
	T(type ii = NULL) : i(ii) {
		cout << ">" << i << ' ';
	}
	~T() { cout << "~" << i << ' '; }
	operator type() const { return i; }
	
	friend ostream&
	operator<<(ostream& os, const T& x) {
		return os << "type: " << x.i;
	}
	
	friend ostream&
	operator<<(ostream& os, const T* x) {
		return os << "type: " << x->i;
	}
};

int main() {
	T<int> Int(9);
	T<double> Double(9.9);
	
	cout << Int << endl;
	cout << Double << endl;
	
}